//
//  ViewController2.m
//  testSyntextApp
//
//  Created by MICHAEL on 15/8/3.
//  Copyright (c) 2015年 kyy. All rights reserved.
//

#import "ViewController2.h"

@interface ViewController2 ()

@end

@implementation ViewController2

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor greenColor];

    UIButton *button1=[[UIButton alloc]init];
    button1.frame=CGRectMake(50, 50, 100, 100);
    button1.backgroundColor=[UIColor yellowColor];
    [button1 addTarget:self action:@selector(goBackTo) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)goBackTo{
    self.navigationController.navigationController.navigationBar.barTintColor=[UIColor clearColor];
[[self.navigationController.navigationController.navigationBar.subviews objectAtIndex:1] setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    [[self.navigationController.navigationController.navigationBar.subviews objectAtIndex:2] setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
     //self.navigationController.navigationController.navigationBar.barTintColor=[UIColor blackColor];
    //[self.navigationController popViewControllerAnimated:YES];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
